In [1]:
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import animation
from __future__ import division
from itertools import product

Greenberg-Hastings model with 1 refractory state, 4 neighbors


In [3]:
class GH(object):
    def __init__(self, initial):
        self._lattice = initial
                    
    def get_lattice(self):
        return self._lattice
    
    
    def evolve(self, time):
        for t in xrange(time):

            hold = np.copy(self._lattice)

            neighbor_sum = sum([ np.roll(self._lattice,shift,axis) for shift,axis in product([-1, +1], [0, 1]) ])

            #refractory states become  rest states
            hold[self._lattice ==1] = 0

            #excited states become refractory
            hold[self._lattice == 5] = 1         

            #rest states with at least one excited neighbor become excited
            hold[(self._lattice == 0) & (neighbor_sum > 4)] = 5

            self._lattice = hold

Greenberg-Hastings model with 1 refractory state, 8 neighbors


In [4]:
class GH_v2(object):
    def __init__(self, initial, thresh):
        self._lattice = initial
        self._threshhold = thresh
        self._X, self._Y = np.shape(initial)
                    
    def get_lattice(self):
        return self._lattice
    
    
    def evolve(self, time):
        for t in xrange(time):

            hold = np.copy(self._lattice)

            neighbor_sum = sum([ np.roll(self._lattice,shift,axis) for shift,axis in product([-1, +1], [0, 1]) ]) \
            + sum([np.roll(np.roll(self._lattice,i,0),j,1) for i, j in product([-1, 1], [-1, 1])])

            #refractory states become  rest states
            hold[self._lattice ==1] = 0

            #excited states become refractory
            hold[self._lattice == 8] = 1         

            #rest states with at least one excited neighbor become excited
            hold[(self._lattice == 0) & (neighbor_sum > (8 * self._threshhold - 1))] = 8

            self._lattice = hold
            
        
    def drive(self, time, p):
        for t in xrange(time):

            hold = np.copy(self._lattice)
            
            Prob = np.random.rand(self._X, self._Y)

            neighbor_sum = sum([ np.roll(self._lattice,shift,axis) for shift,axis in product([-1, +1], [0, 1]) ]) \
            + sum([np.roll(np.roll(self._lattice,i,0),j,1) for i, j in product([-1, 1], [-1, 1])])

            #refractory states become  rest states
            hold[self._lattice ==1] = 0

            #excited states become refractory
            hold[self._lattice == 8] = 1         

            #rest states with at least one excited neighbor become excited
            hold[(self._lattice == 0) & (neighbor_sum > (8 * self._threshhold - 1))] = 8
            
            #seed excited states over rest states with probability p
            hold[(self._lattice == 0) & (Prob < p)] = 8

            self._lattice = hold

Second most general version ; fixed neighborhood of radius 1


In [2]:
class GH_v4(object):
    def __init__(self, initial, refractory_number, thresh):
        self._lattice = initial
        self._threshhold = thresh
        self._X, self._Y = np.shape(initial)
        self._N = refractory_number
                    
    def get_lattice(self):
        return self._lattice
    
    
    def evolve(self, time):
        for t in xrange(time):

            hold = np.copy(self._lattice)

            neighbor_sum = sum([ np.roll(self._lattice,shift,axis) for shift,axis in product([-1, +1], [0, 1]) ]) \
            + sum([np.roll(np.roll(self._lattice,i,0),j,1) for i, j in product([-1, 1], [-1, 1])])

            #refractory states cascade
            for i in xrange(self._N):
                hold[self._lattice == (i+1)] = i

            #excited states become refractory
            hold[self._lattice == (7*self._N) + 1] = self._N         

            #rest states with at least one excited neighbor become excited
            
            #correct
            hold[(self._lattice == 0) & (neighbor_sum > (((7*self._N) + 1) * self._threshhold - 1))] = (7*self._N) + 1
            
            #wrong but looks nice
            #hold[(self._lattice == 0) & (neighbor_sum > ((7*self._N) + 1 * self._threshhold - 1))] = (7*self._N) + 1

            self._lattice = hold
            
            
            
            
    def drive(self, time, p):
        for t in xrange(time):

            hold = np.copy(self._lattice)
            
            Prob = np.random.rand(self._X, self._Y)

            neighbor_sum = sum([ np.roll(self._lattice,shift,axis) for shift,axis in product([-1, +1], [0, 1]) ]) \
            + sum([np.roll(np.roll(self._lattice,i,0),j,1) for i, j in product([-1, 1], [-1, 1])])

            #refractory states cascade
            for i in xrange(self._N):
                hold[self._lattice == (i+1)] = i

            #excited states become refractory
            hold[self._lattice == (7*self._N) + 1] = self._N         

            #rest states with at least one excited neighbor become excited
            hold[(self._lattice == 0) & (neighbor_sum > (((7*self._N) + 1) * self._threshhold - 1))] = (7*self._N) + 1
            
            #randomly seed excited states onto rest states
            hold[(self._lattice == 0) & (Prob < p)] = (7*self._N) + 1

            self._lattice = hold

Most general version


In [3]:
def excited_neighbors(lattice, R):
    X,Y = np.shape(lattice)
    indices = np.arange(-R,R+1)
    bag = product(indices, indices)
    excited = np.zeros((X,Y), dtype = int)
    for i,j in bag:
        if (i,j) == (0,0):
            pass
        else:
            excited[np.roll(np.roll(lattice,i,0),j,1) == 1] += 1
            
    return excited

In [4]:
class GH_v5(object):
    def __init__(self, initial, radius, states_number, thresh):
        self._lattice = initial
        self._threshhold = thresh
        self._X, self._Y = np.shape(initial)
        self._N = states_number
        self._R = radius
        indices = np.arange(-radius, radius+1)
        self._neighbors = product(indices, indices)
                    
    def get_lattice(self):
        return self._lattice
    
    
    def evolve(self, time):        
        for t in xrange(time):

            hold = np.copy(self._lattice)

            #refractory cascade
            for k in xrange(self._N - 2):
                hold[self._lattice == (k+1)] = k+2
                
            #last refractory state goes to rest state
            hold[self._lattice == self._N - 1] = 0
        
            #count number of excited states within neighborhood of radius R
            #excited = np.zeros((self._X, self._Y), dtype = int)
            #for i,j in self._neighbors:
            #    if (i,j) == (0,0):
            #        pass
            #    else:
            #        excited[np.roll(np.roll(self._lattice,i,0),j,1) == 1] += 1
            #print excited    
            
            excited = excited_neighbors(self._lattice, self._R)
            #rest states with threshhold excited neighbor become excited        
            hold[(self._lattice == 0) & (excited >= self._threshhold)] =  1
            

            self._lattice = hold
            
            
    def animate(self):
        fig= plt.figure()
        im = plt.imshow(self.get_lattice(),cmap = plt.cm.hot, vmin=0, vmax = self._N) 
        def updatefig(*args):
            self.evolve(1)
            im.set_array(self.get_lattice())
            return im,

        ani = animation.FuncAnimation(fig, updatefig, interval=10, blit=False)
        plt.colorbar()
        plt.show()

In [5]:
def excited_density(X, Y, p):
    ''' lattice dimension (X,Y) ; excited seed prob p '''
    randz = np.random.rand(X,Y)
    initial = np.zeros((X,Y), dtype = int)
    initial[randz < p] = 1
                
    return initial

In [6]:
def excited_density_v2(X, Y, K, p):
    ''' lattice dimension (X,Y); number of refractory states n; excited seed prob p '''
    randz = np.random.rand(X,Y)
    initial = np.zeros((X,Y), dtype = int)
    initial[randz < p] = 7*K + 1
                
    return initial

In [7]:
def excited_density_v25(X, Y, p):
    ''' lattice dimension (X,Y); number of refractory states n; excited seed prob p '''
    randz = np.random.rand(X,Y)
    initial = np.zeros((X,Y), dtype = int)
    initial[randz < p] = 1
                
    return initial

In [8]:
def excited_density_v3(X, Y, K, p):
    ''' lattice dimension (X,Y); number of refractory states K; excited seed prob p '''
    initial = np.random.random_integers(1, K-1 ,(X,Y))
    for i in xrange(X):
        for j in xrange(Y):
            if np.random.rand() < p:
                initial[i][j] = 0
                
    return initial

In [9]:
def Russell_is_a_blob(L, r, Num_circles, n):
    #initial = np.random.random_integers(0, n, (X,Y))
    initial = np.zeros((L,L))
    center_vals = np.arange(L)
    for t in xrange(Num_circles):
        x = np.random.choice(center_vals)
        y = np.random.choice(center_vals)
        for i in xrange(L):
            for j in xrange(L):
                if np.sqrt((x - i)**2 + (y - j)**2) < r:
                    initial[i][j] = 7*n + 1
                
            
    
    return initial

In [209]:
test = Russell_is_a_blob(200, 20, 5, 10)
im = plt.imshow(test,cmap = plt.cm.rainbow) 
plt.show()

Russell is a blob


In [25]:
refr_N = 5
#initial = excited_density_v2(200, 200, refr_N, 0.2)
initial = Russell_is_a_blob(200, 10, 20, refr_N)
fig= plt.figure()
test = GH_v4(initial, refr_N, 1)

im = plt.imshow(test.get_lattice(),cmap = plt.cm.rainbow, interpolation = 'nearest') 
def updatefig(*args):
    test.evolve(1)
    im.set_array(test.get_lattice())
    return im,

ani = animation.FuncAnimation(fig, updatefig, interval=80, blit=False)
plt.colorbar()
plt.show()

V4 tests


In [29]:
refr_N = 2
initial = excited_density_v2(250, 250, refr_N, 0.1)
#initial = excited_density(200,200, 7*refr_N+1, 1, 0.001)
fig= plt.figure()
test = GH_v4(initial, refr_N, 2)

im = plt.imshow(test.get_lattice(),cmap = plt.cm.rainbow, interpolation = 'nearest') 
def updatefig(*args):
    test.evolve(1)
    im.set_array(test.get_lattice())
    return im,

ani = animation.FuncAnimation(fig, updatefig, interval=40, blit=False)
plt.colorbar()
plt.show()

2-D info dynamics


In [11]:
refr_N = 2
initial = excited_density_v2(250, 250, refr_N, 0.2)
#initial = excited_density(200,200, 7*refr_N+1, 1, 0.001)
fig= plt.figure(figsize = (15,15))
test = GH_v4(initial, refr_N, 2)

im = plt.imshow(test.get_lattice(),cmap = plt.cm.spectral, interpolation = 'nearest') 
def updatefig(*args):
    test.evolve(1)
    im.set_array(test.get_lattice())
    return im,

ani = animation.FuncAnimation(fig, updatefig, interval=40, blit=False)
plt.colorbar()
plt.show()

In [16]:
K = 4
initial = excited_density_v25(250,250, 0.2)
test = GH_v6(initial, 1, K, 2)
test.animate()

In [ ]:

Closest to wikipedia?


In [12]:
refr_N = 15
initial = excited_density_v2(250, 250, refr_N, 0.1)
fig= plt.figure()
test = GH_v4(initial, refr_N, 1)

im = plt.imshow(test.get_lattice(),cmap = plt.cm.rainbow, interpolation = 'nearest') 
def updatefig(*args):
    test.evolve(1)
    im.set_array(test.get_lattice())
    return im,

ani = animation.FuncAnimation(fig, updatefig, interval=40, blit=True)
plt.colorbar()
plt.show()


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in _on_timer(self)
   1303         '''
   1304         for func, args, kwargs in self.callbacks:
-> 1305             ret = func(*args, **kwargs)
   1306             # docstring above explains why we use `if ret == False` here,
   1307             # instead of `if not ret`.

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    989         # delay and set the callback to one which will then set the interval
    990         # back.
--> 991         still_going = Animation._step(self, *args)
    992         if not still_going and self.repeat:
    993             self.frame_seq = self.new_frame_seq()

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _step(self, *args)
    795         try:
    796             framedata = next(self.frame_seq)
--> 797             self._draw_next_frame(framedata, self._blit)
    798             return True
    799         except StopIteration:

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _draw_next_frame(self, framedata, blit)
    813         # Breaks down the drawing of the next frame into steps of pre- and
    814         # post- draw, as well as the drawing of the frame itself.
--> 815         self._pre_draw(framedata, blit)
    816         self._draw_frame(framedata)
    817         self._post_draw(framedata, blit)

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _pre_draw(self, framedata, blit)
    826         # This default implementation allows blit to clear the frame.
    827         if blit:
--> 828             self._blit_clear(self._drawn_artists, self._blit_cache)
    829 
    830     def _draw_frame(self, framedata):

/usr/local/lib/python2.7/site-packages/matplotlib/animation.pyc in _blit_clear(self, artists, bg_cache)
    866         axes = set(a.axes for a in artists)
    867         for a in axes:
--> 868             a.figure.canvas.restore_region(bg_cache[a])
    869 
    870     def _setup_blit(self):

AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region'

In [13]:
R = 1
K = 17
T = 1

initial = excited_density_v3(250,250, K, 0.1)
test = GH_v5(initial, R, K, T)

test.animate()

Nontrivial pattern formation via external driving


In [10]:
refr_N = 8
initial = excited_density_v2(200, 200, refr_N, 0.5)
#initial = excited_density_v3(200, 200, refr_N, 0.5)
fig= plt.figure()
test = GH_v4(initial, refr_N, 2)

im = plt.imshow(test.get_lattice(),cmap = plt.cm.rainbow, interpolation = 'nearest') 
def updatefig(*args):
    test.drive(1,0.2)
    im.set_array(test.get_lattice())
    return im,

ani = animation.FuncAnimation(fig, updatefig, interval=80, blit=False)
plt.colorbar()
plt.show()

In [ ]:


In [14]:
refr_N = 20
initial = excited_density_v2(200, 200, refr_N, 0.1)
#initial = excited_density(200,200, 7*refr_N+1, 1, 0.001)
fig= plt.figure()
test = GH_v4(initial, refr_N, 2)

im = plt.imshow(test.get_lattice(),cmap = plt.cm.rainbow, interpolation = 'nearest') 
def updatefig(*args):
    test.drive(1, 0.8)
    im.set_array(test.get_lattice())
    return im,

ani = animation.FuncAnimation(fig, updatefig, interval=20, blit=True)
plt.colorbar()
plt.show()

In [16]:
refr_N = 20
#initial = excited_density_v2(200, 200, refr_N, 0.5)
initial = excited_density_v3(200, 200, refr_N, 0.5)
fig= plt.figure()
test = GH_v4(initial, refr_N, 2)

im = plt.imshow(test.get_lattice(),cmap = plt.cm.rainbow, interpolation = 'nearest') 
def updatefig(*args):
    test.drive(1,0.7)
    im.set_array(test.get_lattice())
    return im,

ani = animation.FuncAnimation(fig, updatefig, interval=20, blit=True)
plt.colorbar()
plt.show()

Should plot excited state density as a function of time for different values of driving strength

Griffeath parameters


In [15]:
R = 3
K = 8
T = 6

initial = excited_density_v3(300,300, K, 2.0/9)
test = GH_v5(initial, R, K, T)

test.animate()

In [16]:
R = 3
K = 8
T = 6

initial = excited_density_v3(250,250, K, 0.8)
test = GH_v5(initial, R, K, T)

test.animate()


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-16-bfba89e51197> in <module>()
      6 test = GH_v5(initial, R, K, T)
      7 
----> 8 test.animate()

<ipython-input-6-ff3534b26179> in animate(self)
     52         ani = animation.FuncAnimation(fig, updatefig, interval=10, blit=True)
     53         plt.colorbar()
---> 54         plt.show()

/usr/lib/pymodules/python2.7/matplotlib/pyplot.pyc in show(*args, **kw)
    143     """
    144     global _show
--> 145     _show(*args, **kw)
    146 
    147 

/usr/lib/pymodules/python2.7/matplotlib/backend_bases.pyc in __call__(self, block)
    115 
    116         if not is_interactive() or get_backend() == 'WebAgg':
--> 117             self.mainloop()
    118 
    119     def mainloop(self):

/usr/lib/pymodules/python2.7/matplotlib/backends/backend_tkagg.pyc in mainloop(self)
     67 class Show(ShowBase):
     68     def mainloop(self):
---> 69         Tk.mainloop()
     70 
     71 show = Show()

/usr/lib/python2.7/lib-tk/Tkinter.pyc in mainloop(n)
    364 def mainloop(n=0):
    365     """Run the main loop of Tcl."""
--> 366     _default_root.tk.mainloop(n)
    367 
    368 getint = int

AttributeError: 'NoneType' object has no attribute 'tk'

In [16]:
R = 3
K = 15
T = 5

initial = excited_density_v3(250,250, K, 0.8)
test = GH_v5(initial, R, K, T)

test.animate()

Save to gif


In [18]:
R = 3
K = 8
T = 6

initial = excited_density_v3(300,300, K, 2.0/9)
test = GH_v5(initial, R, K, T)

fig= plt.figure()
im = plt.imshow(test.get_lattice(),cmap = plt.cm.hot, interpolation = 'nearest') 
def updatefig(*args):
    test.evolve(1)
    im.set_array(test.get_lattice())
    return im,

ani = animation.FuncAnimation(fig, updatefig, interval=20, blit=True, frames = 100)
ani.save('GHPattern.gif', writer='imagemagick', fps=10)
#plt.colorbar()
plt.show()


Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
    return self.func(*args)
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 536, in callit
    func(*args)
  File "/usr/lib/pymodules/python2.7/matplotlib/backends/backend_tkagg.py", line 141, in _on_timer
    TimerBase._on_timer(self)
  File "/usr/lib/pymodules/python2.7/matplotlib/backend_bases.py", line 1203, in _on_timer
    ret = func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/matplotlib/animation.py", line 876, in _step
    still_going = Animation._step(self, *args)
  File "/usr/lib/pymodules/python2.7/matplotlib/animation.py", line 735, in _step
    self._draw_next_frame(framedata, self._blit)
  File "/usr/lib/pymodules/python2.7/matplotlib/animation.py", line 753, in _draw_next_frame
    self._pre_draw(framedata, blit)
  File "/usr/lib/pymodules/python2.7/matplotlib/animation.py", line 766, in _pre_draw
    self._blit_clear(self._drawn_artists, self._blit_cache)
  File "/usr/lib/pymodules/python2.7/matplotlib/animation.py", line 806, in _blit_clear
    a.figure.canvas.restore_region(bg_cache[a])
KeyError: <matplotlib.axes.AxesSubplot object at 0x7ffa612e2c10>

In [ ]:


In [ ]:


In [13]:
class GH_v6(object):
    '''
    Greenberg-Hasting model. This is a 2-D deterministic cellular automaton that models excitable media. The model has
    three parameters: a finite neighborhood N of the origin, a threshhold number T of sites needed for excitation,
    and the number K of available states (sometimes referred to as colors). Each site in the 2-D lattice can be in one 
    of the K possible states. By convention, the states are given as 0, 1, ..., K-1. 0 is the quiescent or rest 
    state, 1 is the excited state, and k > 1 are refractory states. The sites are updated in parallel according a 
    local homogeneous rule: if a site has color k at time t, it may become (k+1) mod k at time t+1. If k is greater 
    than or equal to 1, this change is automatic. If k = 0 (is in the rest state), it will become excited 
    (take value k = 1 at time t+1) if at least T sites in its neighborhood N are excited (have value k = 1). 
    If the number of excited states in the neighborhood are less than threshhold, the rest state remains at rest. 
    
    '''
    def __init__(self, initial, radius, number_of_states, thresh):
        self._spacetime = initial
        self._threshhold = thresh
        self._Y, self._X = np.shape(initial)
        self._N = number_of_states
        self._R = radius
        indices = np.arange(-radius, radius+1)
        self._neighbors = product(indices, indices)
                    
    def get_lattice(self):
        '''
        Returns the current lattice configuration of the Greenberg Hastings CA.
        '''
        if len(np.shape(self._spacetime)) == 2:
            return self._spacetime
        else:
            y,x,t = np.shape(self._spacetime)
            return self._spacetime[:,:,t-1]
        
    def get_spacetime(self):
        '''
        Returns the 3-D spacetime array, with axes (y-space, x-space, time)
        '''
        return self._spacetime
    
    
    def evolve(self, time): 
        '''
        Evolves the Greenberg-Hastings CA for the given amount of time.
        '''
        for t in xrange(time):
            
            #grab current lattice configuration and copy it
            lattice = self.get_lattice()
            hold = np.copy(lattice)

            #refractory cascade
            for k in xrange(self._N - 2):
                hold[lattice == (k+1)] = k+2
                
            #last refractory state goes to rest state
            hold[lattice == self._N - 1] = 0
        
            excited = excited_neighbors(lattice, self._R)
            #rest states with threshhold excited neighbor become excited        
            hold[(lattice == 0) & (excited >= self._threshhold)] =  1
            

            self._spacetime = np.dstack((self._spacetime,hold))

            
        
    def drive(self, time, p): 
        '''
        Evolves the Greenberg-Hastings CA for the given amount of time with external driving. That is, at every time
        after applying the usual Greenberg-Hastings update rule, randomly excite remaining rests states with probability
        p.
        '''
        for t in xrange(time):
            
            #grab current lattice configuration and copy it
            lattice = self.get_lattice()
            hold = np.copy(lattice)

            #refractory cascade
            for k in xrange(self._N - 2):
                hold[lattice == (k+1)] = k+2
                
            #last refractory state goes to rest state
            hold[lattice == self._N - 1] = 0
        
            excited = excited_neighbors(lattice, self._R)
            #rest states with threshhold excited neighbor become excited        
            hold[(lattice == 0) & (excited >= self._threshhold)] =  1
            
            #randomly flip rest states into excited states (this is the driving)
            Prob = np.random.rand(self._X, self._Y)
            hold[(lattice == 0) & (Prob < p)] = 1
            
            self._spacetime = np.stack((self._spacetime,hold))
    
           
            
            
    def animate(self):
        fig= plt.figure()
        im = plt.imshow(self.get_lattice(),cmap = plt.cm.hot, vmin=0, vmax = self._N) 
        def updatefig(*args):
            self.evolve(1)
            im.set_array(self.get_lattice())
            return im,

        ani = animation.FuncAnimation(fig, updatefig, interval=10, blit=False)
        plt.colorbar()
        plt.show()

In [14]:
def spacetime_animation(spacetime_field, colorbar = False, colors = plt.cm.bone, max_val = None, \
                       interval = 10, frames = None, blit = False, embed = False):
    '''
    Animates evolution of 2-D spatial lattice systems. Takes 3-D spacetime array as input and animates the time 
    slices of this spacetime array.
    '''
    y,x,t = np.shape(spacetime_field)
    frames = t
    if colorbar:
        max_val = max(np.unique(spacetime_field))
        min_val = min(np.unique(spacetime_field))
        fig = plt.figure()
        it = 0
        im = plt.imshow(spacetime_field[:,:,it], cmap = colors, vmin = min_val, vmax = max_val)
        def updatefig(*args):
            it+=1
            im.set_array(spacetime_field[:,:,it])
            return im
        
        ani = animation.FuncAnimation(fig, updatefig, interval = interval, frames = frames, blit = blit)
        plt.colorbar()
        
        
    else:
        fig = plt.figure()
        i = iter(range(t))
        im = plt.imshow(spacetime_field[:,:,i.next()], cmap = colors, interpolation = 'nearest')
        def updatefig(*args):
            im.set_array(spacetime_field[:,:,i.next()])
            return im
        
        ani = animation.FuncAnimation(fig, updatefig, interval = interval, \
                                      frames = frames, blit = blit)
    
    
    if embed:
        display_animation(ani)
    else:    
        plt.show()

In [20]:
from tempfile import NamedTemporaryFile

VIDEO_TAG = """<video controls>
 <source src="data:video/x-m4v;base64,{0}" type="video/mp4">
 Your browser does not support the video tag.
</video>"""

def anim_to_html(anim):
    animation.Animation._repr_html_ = anim_to_html
    if not hasattr(anim, '_encoded_video'):
        with NamedTemporaryFile(suffix='.mp4') as f:
            anim.save(f.name, fps=20, extra_args=['-vcodec', 'libx264'])
            video = open(f.name, "rb").read()
        anim._encoded_video = video.encode("base64")
    
    return VIDEO_TAG.format(anim._encoded_video)

In [16]:
from IPython.display import HTML

def display_animation(anim):
    plt.close(anim._fig)
    return HTML(anim_to_html(anim))

In [ ]:


In [9]:
R = 3
K = 8
T = 6

initial = excited_density_v3(300,300, K, 2.0/9)
test = GH_v6(initial, R, K, T)
test.evolve(200)

In [13]:
%matplotlib inline

In [10]:
spacetime_animation(test.get_spacetime(), colors = plt.cm.Set2)

In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [107]:
R = 3
K = 8
T = 6

initial = excited_density_v3(30,30, K, 2.0/9)

In [119]:
test_5 = GH_v5(initial, R, K, T)
test_6 = GH_v6(initial, R, K, T)

In [ ]:


In [120]:
print test_5.get_lattice()


[[0 6 1 4 5 7 0 0 7 3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